

#ifndef UC_GETORUS_H
#define UC_GETORUS_H

#include "zgegbl.h"
#include "zgesurf.h"
#include "zgeintrvl.h"
#include "zgevec3d.h"
#pragma pack (push, 8)

class UcGeCircArc3d;

class
GX_DLLEXPIMPORT
UcGeTorus : public UcGeSurface
{
public:
    UcGeTorus();
    UcGeTorus(double majorRadius, double minorRadius,
              const UcGePoint3d& origin, const UcGeVector3d& axisOfSymmetry);
    UcGeTorus(double majorRadius, double minorRadius,
              const UcGePoint3d&  origin, const UcGeVector3d& axisOfSymmetry,
              const UcGeVector3d& refAxis,
              double startAngleU, double endAngleU,
              double startAngleV, double endAngleV);
    UcGeTorus(const UcGeTorus& torus);

    double          majorRadius    () const;
    double          minorRadius    () const;
    void            getAnglesInU   (double& start, double& end) const;
    void            getAnglesInV   (double& start, double& end) const;
    UcGePoint3d     center         () const;
    UcGeVector3d    axisOfSymmetry () const;
    UcGeVector3d    refAxis        () const;
    ZSoft::Boolean  isOuterNormal  () const;

    UcGeTorus&      setMajorRadius (double radius);
    UcGeTorus&      setMinorRadius (double radius);
    UcGeTorus&      setAnglesInU   (double start, double end);
    UcGeTorus&      setAnglesInV   (double start, double end);
    UcGeTorus&      set            (double majorRadius, double minorRadius,
                                    const UcGePoint3d& origin,
                                    const UcGeVector3d& axisOfSymmetry);
    UcGeTorus&      set            (double majorRadius, double minorRadius,
                                    const UcGePoint3d&  origin,
                                    const UcGeVector3d& axisOfSymmetry,
                                    const UcGeVector3d& refAxis,
                                    double startAngleU, double endAngleU,
                                    double startAngleV, double endAngleV);

	UcGeTorus&		set				(const UcGePoint3d& cent,
									 const UcGeVector3d& nrm,
									 const UcGeVector3d& refVec, double radius,
								     double startAngle, double endAngle);	// INTERNAL USE ONLY

	UcGeTorus&      set				(const UcGePoint3d& cent,
									const UcGeVector3d& nrm,
									double radius);			// INTERNAL USE ONLY

    UcGeTorus&      operator =     (const UcGeTorus& torus);

    ZSoft::Boolean  intersectWith  (const UcGeLinearEnt3d& linEnt, int& intn,
                                    UcGePoint3d& p1, UcGePoint3d& p2,
                                    UcGePoint3d& p3, UcGePoint3d& p4,
                                    const UcGeTol& tol = UcGeContext::gTol) const;

    ZSoft::Boolean isLemon     () const;
    ZSoft::Boolean isApple     () const;
    ZSoft::Boolean isVortex    () const;
    ZSoft::Boolean isDoughnut  () const;
    ZSoft::Boolean isDegenerate() const;
    ZSoft::Boolean isHollow    () const;
};

#pragma pack (pop)
#endif
